﻿project(cms-demo)

cmake_minimum_required(VERSION 2.8)
add_definitions(-D CMS)

include_directories(${DEMO_ROOT_DIR}/cms/header)
include_directories(${DEMO_ROOT_DIR}/include)
include_directories(${DEMO_ROOT_DIR}/include/cms)

LINK_DIRECTORIES(${LINK_DIR_FOR_PIS})

add_executable(cms-server ../cms/source/IEC61850Functions.c
                      ../cms/source/LocalData.c
                      ../cms/source/MainServer.c
                      ../cms/source/PIS10CreateServerClient.c
                      ../cms/source/PIS10Callbacks.c
                      ../cms/source/PrintView.c
                      ../cms/source/UserInput.c)
target_link_libraries(cms-server cms-ctk)

add_executable(cms-client ../cms/source/IEC61850Functions.c
                      ../cms/source/LocalData.c
                      ../cms/source/MainClient.c
                      ../cms/source/PIS10CreateServerClient.c
                      ../cms/source/PIS10Callbacks.c
                      ../cms/source/PrintView.c
                      ../cms/source/UserInput.c)
target_link_libraries(cms-client cms-ctk)

add_executable(cms-server-sub ../cms/source/IEC61850Functions.c
                      ../cms/source/LocalData.c
                      ../cms/source/MainServerSubscription.c
                      ../cms/source/PIS10CreateServerClient.c
                      ../cms/source/PIS10Callbacks.c
                      ../cms/source/PrintView.c
                      ../cms/source/UserInput.c)
target_link_libraries(cms-server-sub cms-ctk)

if(NOT EXISTS ${CMAKE_CURRENT_BINARY_DIR}/cms-ctk.dll)
    file(COPY ${LINK_DIR_FOR_PIS}/cms-ctk.dll DESTINATION ${CMAKE_CURRENT_BINARY_DIR})
endif()




